package com.estar.workparent.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.common.model.json.AjaxJson;
import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.web.system.service.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.estar.worktime.entity.TmblWorktimeEntity;

@Controller
@RequestMapping("/workTableNO")
@Scope("prototype")
public class WorkTableNO {
	
	@Autowired
	private SystemService systemService;
	
	@RequestMapping(params = "getNo")
	@ResponseBody
	public String getNo(TmblWorktimeEntity tmblWorktime, HttpServletRequest request) {
		String msg = null;
		
		String day=request.getParameter("da");
		String sql1="select w.id from tmbl_worktime_parent w where w.DAY='"+day+"'";
		List<String> lis=this.systemService.findListbySql(sql1);
		if(lis==null && lis.size()<=0){
			msg="1";
		}else{
			int i=lis.size();
			int jj=i+1;
			String no=String.valueOf(jj);
			
			msg=no;
		}
		String json="{\"msg\":\""+msg+"\"}";
		return json;
	}
}
